﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <meta name="viewport" content="width=device-width" />
        <script src="<%: Url.Content("~/Scripts/jquery-1.7.1.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/WaitingDlg/WaitingDlg.js") %>" type="text/javascript"></script>
<link href="<%: Url.Content("~/Scripts/WaitingDlg/WaitingDlg.css") %>"  rel="stylesheet" type="text/css" />
    <title>LoginUser</title>
        <script type="text/javascript">

            $(function () {
                //  var imgWait = '<%= Url.Content("~/Images/spinner.gif") %>'
                $("#txtNm").focus();
                $(".txtLogin").keypress(function (event) {
                    if (event.which == 13) {
                        event.preventDefault();
                        $("#login").click();
                    }
                });

                $("#login").click(function () {
                    // WAITINGDLG_show(imgWait);
                    if ($("#txtNm").val().length <= 0) {
                        $("#txtNm").focus();
                        alert("ระบุ Username ");
                        return;
                    }
                    if ($("#txtpassword").val().length <= 0) {
                        $("#txtpassword").focus();
                        alert("ระบุ password ");
                        return;
                    }
                    $.post('<%=Url.Action("LoginWIN","Account") %>?UserName=' + $("#txtNm").val() + '&Password=' + $("#txtpassword").val()
            , function (data) {
                if (data.success != "0") {
                    var getUsersUrl = ('<%= ViewBag.ReturnUrl %>');
                    //                    if(getUsersUrl==""){
                    //                        getUsersUrl = '<%=Url.Action("Index","WorkOrder") %>';
                    //                     }
                    window.location = getUsersUrl;
                } else alert(data.message);
            });
                    //  WAITINGDLG_hide();


                });
            });
</script>
<style type="text/css">

.txtLogin {
	margin-left:120px; 
	height:38px; 
	width:180px; 
	border:0px; 
	background-color:transparent;
	font-size:14px;
	margin-top:10px;
}
#bg1
{
    background-image: url('<%=Page.ResolveUrl("~/Images/login_03.jpg")%>');
    width: 406px;
    height: 58px;
}
#bg2
{
    background-image:  url('<%=Page.ResolveUrl("~/Images/login_05.jpg")%>');
    width: 406px;
    height: 23px;
}
#bg3
{
    background-image:  url('<%=Page.ResolveUrl("~/Images/login_06.jpg")%>');
    width: 52px;
    height: 52px;
    float: left;
}

#bg4
{
    background-image:  url('<%=Page.ResolveUrl("~/Images/login_07.jpg")%>');
    width: 308px;
    height: 52px;
    float: left;
}
#bg5
{
    background-image: url('<%=Page.ResolveUrl("~/Images/login_08.jpg")%>');
    width: 46px;
    height: 52px;
    float:right;
    margin-right:2px;
}
#bg6
{
    background-image:  url('<%=Page.ResolveUrl("~/Images/login_09.jpg")%>');
    width: 405px;
    height: 57px;
    float: left;
}
#bg7
{
    background-image:  url('<%=Page.ResolveUrl("~/Images/login_10.jpg")%>');
    width: 1px;
    height: 57px;
    float: left;
}
#bg8
{
    background-image:  url('<%=Page.ResolveUrl("~/Images/login_11.jpg")%>');
    width: 406px;
    height: 10px;
}
#bg9
{
    background-image:  url('<%=Page.ResolveUrl("~/Images/login_14.jpg")%>');
    width: 406px;
    height: 24px;
}
#bg10
{
    background-image:  url('<%=Page.ResolveUrl("~/Images/login_15.jpg")%>');
    width: 408px;
    height: 24px;
}

</style>
</head>
<body style="background-color:#EDEDED; width:100%; height:700;" >
<form action="" method="post">
<div id="bodys" style="background-color:#FFF; width:408px; height:280px;margin:auto; margin-top:10% ">
    <div id="bg1" ></div>
    <div id="bg2" ></div>
    <div id="bg3" ></div>
    <div id="bg4">
         <div style="float:left"><input type="text" class="txtLogin" id="txtNm" value="jittra" /></div> 
        
     </div>
      <div id="bg5"></div>
    <div style="clear:both"></div>
            <div id="bg6" >
            <div>
            <input type="password" class="txtLogin" id="txtpassword" value="pass6950" style="margin-left:170px; margin-top:20px;"" />
          </div></div>
          <div id="bg7">
     </div>

<div style="clear:both"></div>
 <div id="bg8" ></div>
 <div style="width:406px; height:42px;">
<div style="float:left"><img src="<%: Url.Content("~/images/login_13_01.jpg")%>" width="19" height="42" alt=""></div>
<div style="float:left; margin-left:93px;">
<button id="login" type="button" style="width:180px; height:42px; border-color:transparent;" >
<img src="<%: Url.Content("~/images/login_13_02.jpg")%>" style="width:180px; height:42px; background-image"></button>
</div>
<div style="float:right;"><img src="<%: Url.Content("~/images/login_13_05.jpg")%>" width="19" height="42" alt=""></div>
</div>

  <div id="bg9" ></div>
  <div id="bg10" ></div>
  </div>
  </form>
</body>
</html>
